﻿@model EasyStep.Website.Models.TestConstListCreateModel
@{
    ViewBag.Title = "Create New Constant List";
}
<h2>Create New Constant List</h2>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)

    <fieldset>
        <legend></legend>
        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.ProjectNameOrId)
        </div>
        <div class="editor-field projects-list">
            @Html.EditorFor(model => model.ProjectNameOrId)
            @Html.ValidationMessageFor(model => model.ProjectNameOrId)
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Description)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Description)
            @Html.ValidationMessageFor(model => model.Description)
        </div>
        <p>
            <input type="submit" value="Create"  class="ui-button ui-corner-all"/>
        </p>
    </fieldset>
}
<div>
    @Html.ActionLink("Back to List", "Index")
</div>
<script src="@Url.Content("~/Scripts/jquery.comboBox.js")" type="text/javascript"></script>

<script type="text/javascript">
    $(document).ready(function () {        
        var prEditor=$(".projects-list");
        var curEditor=prEditor.find("input");
        InitAutocomplete(prEditor, curEditor,"@Url.Action("AvailableProjects","TestProject")");
    });
    
</script>